#pragma once

#include "shape.h"
class MTorus : public Shape
{
private:
	float ox, oy, oz;	//center of sphere
	float r1;	//distance from the center of the tube to th center of the torus
	float r2;	//radius of the tube
	int rs, vs;	//number of circles along and across the tube
	MVertex **verts;
	MVertex **normal;
	int step;
private:
	MTorus(float ar1, float ar2, int ars, int avs, float aox = 0, float aoy = 0,float aoz = 0);
public:
	static MTorus *makeTorus(float ar1, float ar2, int ars, int avs, float aox = 0, float aoy = 0,float aoz = 0);
	~MTorus(void);
	void drawShape();
	void drawTorus(void(*func)(const MVertex &p1,  const MVertex &p2, const MVertex &p3, int ic),
		void(*drawline)(const MVertex &p1,  const MVertex &p2,int ic)=NULL);
	void updateTorus(float ar1, float ar2, int ars, int avs, float aox = 0, float aoy = 0,float aoz = 0);
	bool isComplete() const;
	void resetStep();
	void incrementSlice();
	void decrementSlice();
	void incrementStack();
	void decrementStack();
};

